﻿using System;
using System.Collections.Generic;
using Autodesk.Revit.DB;

namespace ExtendedFilter.ExtendedFilter
{
	public class TypeItemData : ItemData
	{
		public TypeItemData(TypeItemData rhs)
		{
			this.m_Name = rhs.m_Name;
			this.m_Selected = rhs.m_Selected;
			this.m_Elements = rhs.m_Elements;
		}

		public TypeItemData(string name, List<Element> elements)
		{
			this.m_Name = name;
			this.m_Selected = true;
			this.m_Elements = elements;
		}

		public string TheName
		{
			get
			{
				return this.m_Name;
			}
		}

		public bool Selected
		{
			get
			{
				return this.m_Selected;
			}
		}

		public List<Element> Elements
		{
			get
			{
				return this.m_Elements;
			}
		}

		public void AddElement(Element ele)
		{
			this.m_Elements.Add(ele);
		}

		public override List<Element> GetSelectElements(FilterType filterType)
		{
			if (this.m_Selected)
			{
				return this.m_Elements;
			}
			return new List<Element>();
		}

		public override List<Element> GetAllElements()
		{
			return this.Elements;
		}

		public override void SetSelected(bool selected)
		{
			this.m_Selected = selected;
		}

		private string m_Name;

		private bool m_Selected = true;

		private List<Element> m_Elements = new List<Element>();
	}
}
